package com.tanhua.dubbo.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfig {

    //开启分页查询

    /**
     * 自动扫描所有的mapper方法,找到参数中的包含page对象的,对执行sql语句进行分页处理
     * 1.统计总数
     * 2.自动在sql语句后面拼接limit
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }
}